<?php
/**
 * True Gallery Component for Joomla CMS
 *
 * @version 2.5
 * @author Alexey N. Brin (userxp@joomlaportal.ru)
 * @homepage http://truegallery.ru 
 * @filename toolbar.true.php
 * @package True Gallery
 * @copyright (C) 2008-2009 by joomlatune.ru
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 * 
 * THIS GALLERY is an EVOLUTION of AkoGallery -> PonyGallery -> DatsoGallery
 *
 * If you fork this to create your own project, 
 * please make a reference to True Gallery someplace in your code 
 * and provide a link to http://www.joomlatune.ru
 *
 * LAST UPDATED 27.03.2009 00:03 IEV
 **/

defined('_VALID_MOS') or defined('_JEXEC') or die('Direct Access to this location is not allowed.');

$view = getUrlParam( 'view', 'show' );
$task = getUrlParam( 'task', 'pictures' );

if( !class_exists( 'mosMenuBar' ) ) {
	include_once JPATH_PLUGINS.DS.'system'.DS.'legacy'.DS.'menubar.php';
}

switch( $task ) {
	//case 'showbatch'		:
	//case 'import'			:
	//case 'showimport'		:
	case 'new'				:
	case 'batch'				:
	case 'add'				:
	case 'edit'				: JTrueGalleryMenu::EDIT_MENU(); break;
	
	case 'show'				: 
	default					: switch( $view ) {
		case 'votes'			: break;
		case 'upload'		: JTrueGalleryMenu::UPLOAD_MENU();break;
		case 'rebuild'		: JTrueGalleryMenu::IMPORT_MENU();break;
		case 'settings'		: JTrueGalleryMenu::CONFIG_MENU(); break;
		case 'categories'	: JTrueGalleryMenu::CTG_MENU(); break;
		default				: JTrueGalleryMenu::DEFAULT_MENU(); break;
	}
}


class JTrueGalleryMenu {
	function NEW_CTG_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('savecatg', JText::_('TG_SAVEPIC_TB'));
		mosMenuBar::spacer();
		mosMenuBar::cancel('cancel', JText::_('TG_CANCEL_TB'));
		mosMenuBar::endTable();
	}

	function EDIT_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('save', JText::_('TG_SAVEPIC_TB'));
		mosMenuBar::spacer();
		mosMenuBar::apply('apply', JText::_('TG_APPLYPIC_TB'));
		mosMenuBar::spacer();
		mosMenuBar::cancel('cancel', JText::_('TG_CANCEL_TB'));
		mosMenuBar::endTable();
	}

	function MOVE_PIC_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('movepicres', JText::_('TG_SAVEPIC_TB'));
		mosMenuBar::spacer();
		mosMenuBar::cancel('cancel', JText::_('TG_CANCEL_TB'));
		mosMenuBar::endTable();
	}

	function EDIT_CTG_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::custom('save', 'save', '', JText::_('TG_SAVEPIC_TB'));
		mosMenuBar::spacer();
		mosMenuBar::custom('cancel', 'cancel', '', JText::_('TG_CANCEL_TB'));
		mosMenuBar::endTable();
	}

	function CTG_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::publishList('publish', JText::_('TG_PUBLISHCAT_TB'));
		mosMenuBar::unpublishList('unpublish', JText::_('TG_UNPUBLISHCAT_TB'));
		mosMenuBar::addNew('add', JText::_('TG_ADD_CAT'));
		mosMenuBar::custom('move', 'move', '', JText::_('TG_MOVE_CATEGORY') );
		mosMenuBar::deleteList('', 'remove', JText::_('TG_REMOVECAT_TB'));
		mosMenuBar::endTable();
	}

	function DEFAULT_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::custom('rename', 'rename', '', JText::_('TG_RENAME'));
		mosMenuBar::custom('filter', 'filter', '', JText::_('TG_FILTER'));
		mosMenuBar::custom('clear', 'clear', '', JText::_('TG_CLEAR'));
		mosMenuBar::custom('publish', 'publish', '', JText::_('TG_PUBLISHPIC_TB'));
		mosMenuBar::custom('unpublish', 'unpublish', '', JText::_('TG_UNPUBLISHPIC_TB'));
		mosMenuBar::custom('approve', 'approve', '', JText::_('TG_APPROVEPIC_TB'));
		mosMenuBar::custom('reject', 'reject', '', JText::_('TG_REJECTPIC_TB'));
		mosMenuBar::custom('move', 'move', '', JText::_('TG_MOVE_PICS'));
		mosMenuBar::custom('add', 'add', '', JText::_('TG_ADDNEWPIC_TB'));
		mosMenuBar::deleteList('', 'remove', JText::_('TG_DELETEPIC_TB'));
		mosMenuBar::endTable();
	}

	function CONFIG_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::custom('save', 'save', '', JText::_('TG_SAVEPIC_TB'));
		mosMenuBar::spacer();
		mosMenuBar::custom('cancel', 'cancel', '', JText::_('TG_CANCEL_TB'));
		mosMenuBar::endTable();
	}

	function IMPORT_MENU() {
	}

	function UPLOAD_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('upload', JText::_('TG_UPLOAD_TB'));
		mosMenuBar::spacer();
		mosMenuBar::cancel();
		mosMenuBar::endTable();
	}

	function RESET_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::save('rest', JText::_('TG_RESET_TB'));
		mosMenuBar::spacer();
		mosMenuBar::cancel();
		mosMenuBar::endTable();
	}
	
	function COMMENTS_MENU() {
		mosMenuBar::startTable();
		mosMenuBar::custom('publish', 'publish', '', JText::_('TG_PUBLISHCMT_TB'));
		mosMenuBar::spacer();
		mosMenuBar::custom('unpublish', 'unpublish', '',  JText::_('TG_UNPUBLISHCMT_TB'));
		mosMenuBar::spacer();
		mosMenuBar::deleteList('', 'removecmt', JText::_('TG_REMOVECMT_TB'));
		mosMenuBar::endTable();
	}
}
?>
